<?php
include 'mySQLConnect.php';
?>


    <div class="widget">
        <div class="giohang"><h3>Giỏ hàng</h3></div>

        <div id="widget-header-2">
            <div id="social_networks-5">
                <ul class="social-networks">
                    <li class="display-icons">
                        <a title="xem giỏ hàng" href="cart.php">
                            <img src="images/cart.png"/> <span
                                style="font-weight: bold;font-size: 14px" id="prod-qty">0</span>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="clear"></div>
    <div class="widget">
        <div class="giohang"><h3>Danh mục</h3></div>
        <ul>
            <?php
            $sql3 = "SELECT * FROM category";

            $result3 = mysql_query($sql3);
            while ($row3 = mysql_fetch_array($result3)) {
                ?>
                <li class="cat-item"><a href="searchProduct.php?type=cate&cat_id=<?php echo $row3['id'] ?>">
                        <?php echo urldecode($row3['cat_name']) ?>
                    </a>
                </li>
            <?php
            }
            ?>
        </ul>
    </div>

    <div class="widget" id="top-rated-2">
        <div class="giohang"><h3>Nhà sản xuất</h3></div>
        <ul>
            <?php
            $sql3 = "SELECT distinct(fac) FROM product";

            $result3 = mysql_query($sql3);
            while ($row3 = mysql_fetch_array($result3)) {
                ?>
                <li class="cat-item"><a href="searchProduct.php?type=fac&fac=<?php echo $row3['fac'] ?>">
                        <?php echo urldecode($row3['fac']) ?>
                    </a>
                </li>
            <?php
            }
            ?>
        </ul>
    </div>
    <div class="widget" id="top-rated-2">
        <div class="giohang"><h3>Tìm Kiếm</h3></div>


        <form action="searchProduct.php" method="get">
            <input type="hidden" name="type" value="price">
            <table>
                <tr>
                    <td><label for="pStart">Từ giá: </label></td>
                    <td><input type="text" name="pStart" placeholder="Từ giá"></td>
                </tr>
                <tr>
                    <td><label for="pEnd">Tới giá: </label></td>
                    <td><input type="text" name="pEnd" placeholder="Tới giá"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input type="submit" value="Tìm sản phẩm"></td>
                </tr>
            </table>
        </form>
    </div>

<?php
include 'mySQLClose.php';
?>